package DaEr_5_25;

import java.util.ArrayList;
import java.util.Random;

public class Member extends User{
    public Member() {
    }
    public Member(String name,Integer money){
        super(name, money);
    }
    public void recevie(ArrayList<Integer> list){
        int anInt = new Random().nextInt(list.size());//随机产生一个红包
        //从红包集合中删掉抽到的红包元素，并且获得删掉的值
        Integer remove = list.remove(anInt);//从集合中删掉抽走的红包
        //原来的余额
        Integer money = super.getMoney();
        //收到红包后总的余额
        super.setMoney(money+remove);

    }
}
